#include "water_level_display.h"
#include "ui_water_level_display.h"
#include "main.h"


water_level_display::water_level_display(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::water_level_display)
{
    ui->setupUi(this);
    ui->verticalSlider->setRange(0,6);
//    timer=new QTimer();
//  QObject:: connect( timer, SIGNAL(timeout()), SLOT(timeDone()) );
 //    timer->start(500);

}

water_level_display::~water_level_display()
{
    delete ui;
 //   delete timer;
}

void water_level_display::timeDone()
{
      static int count;
      if(water_valve_status){
        ui->verticalSlider->setValue(count++);
        if(count==7) count=0;
      }
      else   ui->verticalSlider->setValue(water*3);
}
